import http from '@/api/request';

// 获取口碑列表
export const getPraises = (page: number, limit: number, category_id: number) => {
  return http.request({
    method: 'GET',
    url: '/app/praise/list',
    params: { page_size: limit, page: page, category_id: category_id, status: 1 },
  });
};

// 获取口碑详情列表
export const getPraiseDetail = (praise_id: number) => {
  return http.request({
    method: 'GET',
    url: '/app/praise/detail',
    params: { id: praise_id, status: 1 },
  });
};

// 口碑点赞
export const setPraiseLike = (praise_id: number, is_like: number) => {
  return http.request({
    method: 'POST',
    url: '/app/praise/set_like',
    data: { praise_id: praise_id, status: is_like },
  });
};

// 口碑评论
export const setPraiseComment = (praise_id: number, content: string) => {
  return http.request({
    method: 'POST',
    url: '/app/praise/set_comment',
    data: { praise_id: praise_id, content: content },
  });
};

// 口碑评论列表
export const getPraiseComments = (page: number, limit: number, praise_id: number) => {
  return http.request({
    method: 'GET',
    url: '/app/praise/comment_list',
    params: { page_size: limit, page: page, praise_id: praise_id, status: 1 },
  });
};
